package com.rjyb.student_management_platform.unit.common;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTime {
    public String nowTime(){
        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(date);
    }
    public String nowYear(){
        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(date);
    }
}
